SELECT T.*,
  T_ROLE.CODE          AS ROLE_CODE,
  T_ROLE.NAME          AS ROLE_NAME,
  T_PERMISSION.CODE    AS PERMISSION_CODE,
  T_PERMISSION.NAME    AS PERMISSION_NAME,
  T_PERMISSION.TYPE_ID AS PERMISSION_TYPE_ID,
  T_DICTIONARY.CODE    AS PERMISSION_TYPE_CODE,
  T_DICTIONARY.NAME    AS PERMISSION_TYPE_NAME
FROM C1_ROLE_PERMISSION T
LEFT JOIN C1_ROLE T_ROLE
ON (T_ROLE.ID = T.ROLE_ID)
LEFT JOIN C1_PERMISSION T_PERMISSION
ON (T_PERMISSION.ID = T.PERMISSION_ID)
LEFT JOIN C1_DICTIONARY T_DICTIONARY
ON (T_DICTIONARY.ID = T_PERMISSION.TYPE_ID)
WHERE T.ID = :id